package com.koron.ticket.feign;

import com.koron.bean.base.Response;
import com.koron.common.core.feignConfig.FeignFallbackFactory;
import com.koron.ticket.feign.bean.defectDispatch.DispatchVO;
import com.koron.ticket.work.common.bean.OverhaulOrderBean;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Author: rocky
 * @Date: 2022/1/14 16:03
 */
@FeignClient(value = "eam-service-order", fallbackFactory = FeignFallbackFactory.class)
public interface TicketChangeStatusFeign {

    /**
     * 缺陷工单
     *
     * @param orderId
     * @param status
     * @return
     */
    @GetMapping("/defect/submitDefect")
    Response submitDefect(@RequestParam("orderId") String orderId, @RequestParam("status") String status);

    /**
     * 线路缺陷工单状态变更
     *
     * @param orderId
     * @param status
     * @return
     */
    @GetMapping("/lineDefect/submitDefect")
    Response submitLineDefect(@RequestParam("orderId") String orderId, @RequestParam("status") String status);

    /**
     * 保存线路缺陷工单派工信息
     *
     */
    @PostMapping("/lineDefect/dispatch/saveDispatchInfo")
    Response saveLineDispatchInfo(@RequestBody DispatchVO dispatchVO);

    /**
     * 计划检修工单
     *
     * @param repairId
     * @param status
     * @return
     */
    @GetMapping("/repair/submitRepair")
    Response submitRepair(@RequestParam("repairId") String repairId, @RequestParam("status") String status);

    /**
     * 试验工单
     *
     * @param orderId
     * @param status
     * @return
     */
    @GetMapping("/experiment/submitExperiment")
    Response submitExperiment(@RequestParam("orderId") String orderId, @RequestParam("status") String status);

    /**
     * 维护工单
     * @param maintainId
     * @param status
     * @return
     */
    @GetMapping("/maintain/submitTicketMaintain")
    Response submitMaintain(@RequestParam("maintainId") String maintainId, @RequestParam("status") String status);

    /**
     * 大修工单
     *
     * @param bean
     * @return
     */
    @PostMapping("/overhaul/submit")
    Response<String> toExecute(@RequestBody OverhaulOrderBean bean);
}
